<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const expressNumber1 = "SF-20230429-000001";

    function getLogisticsStatus(expressNumber) {
      const parts = expressNumber.split("-");
      if (parts.length !== 3) {
        return null;
      }
      const [company, date, serialNumber] = parts;
      if (company.length !== 2 || !/^\d{8}$/.test(date) || !/^\d{6}$/.test(serialNumber)) {
        return null;
      }
      const logisticsStatus = {
        company,
        date: `${date.substring(0, 4)}-${date.substring(4, 6)}-${date.substring(6, 8)}`,
        serialNumber,
      };
      const keys = Object.keys(logisticsStatus);
      const values = Object.values(logisticsStatus);
      console.log(`物流状态信息：${keys[0]}=${values[0]}, ${keys[1]}=${values[1]}, ${keys[2]}=${values[2]}`);
      return logisticsStatus;
    }
    getLogisticsStatus(expressNumber1)
  </script>
</body>

</html>